<?php
	require_once '../../../include/Zend/JSON.php';
	$json = new Services_JSON();
	
	include("../../../include/class.function.php");
	$inancm = new inancm();
	
	
	foreach($_REQUEST as $key => $value)  {
		$$key = $value;
	}
	
	error_reporting(E_ALL ^ E_NOTICE);
	
	$sql_chklock = "SELECT blog_show FROM inancm_blog WHERE blog_id = '".$id."'";
	$data_chklock = $inancm->select_db($sql_chklock);
	//$inancm->pre($data_chklock);
	$data_status = $data_chklock[0]['blog_show'];
	
	if ($data_status == 1){
		$chang_status = 0;		
		$data['show'] = "<span class='label label-warning'>hide</span>";
		$data['icon'] = "<i class='glyphicon glyphicon-eye-close' style='cursor:pointer;'></i>";
	} else {
		$chang_status = 1;
		$data['show'] = "<span class='label label-success'>show</span> ";
		$data['icon'] = "<i class='glyphicon glyphicon-eye-open' style='cursor:pointer;'></i>";
	}
	
	$Table_Name = 'inancm_blog';
	$data_blog = array(
			'blog_show'=>$chang_status
	);
	$sql = $inancm->update_db($Table_Name, array('blog_id='=>$id), $data_blog);
	mysql_query($sql);

	echo $_GET['callback'].'('.$json->encode($data).')';

?>